<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link type="text/css" rel="stylesheet" href="css/personal.css"/>
    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="js/personal.js"></script>
    <title>个人中心-我的简历</title>
</head>

<body>
<div class="header">
    <div class="headerMain">
        <div class="Notice">
        </div>
        <div class="Account">
            <div class="Left">
                <div class="Info">
                    <font>${user.uname}</font>
                    <input type="button">
                    <div id="InfoPopup">
                        <ul>
                            <li><a href="exit.do">退出</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="navTop">
    <div class="navTopmain">
        <div class="logo"><a href="index.jsp"><img src="images/logo_1.png"/><img src="images/logo_2.png"/></a></div>
    </div>
</div>
<div class="personalBody">
    <div id="base_div" class="perRightcon">
        <div class="JlBoxTit">
            <p class="tit1">基本资料/求职意向</p>
            <div class="tit2"></div>
            <p class="tit3">最高学历</p>
        </div>
        <div class="JlBoxCon">
            <h1><span>基本信息</span>
                <div></div>
            </h1>
            <div class="JlBoxLeft">
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>姓 名：</div>
                    <div class="inputtxt">
                        <input id="uname" value="${user.uname}" name="" type="text" class="txt1"/>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>性 别：</div>
                    <div class="inputtxt">
                        <div id="usexman" class="sex on">男</div>
                        <div id="usexwomen" class="sex">女</div>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>出生年月：</div>
                    <div class="inputtxt">
                        <input id="ubirthday" name="" type="date" class="txt8"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>现居住地：</div>
                    <div class="inputtxt">
                        <input id="uplace" name="" value="${user.uplace}" type="text" class="txt7"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>户口所在地：</div>
                    <div class="inputtxt">
                        <input id="udomicile" name="" value="${user.udomicile}" type="text" class="txt7"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>我成长在：</div>
                    <div class="inputtxt">
                        <input id="ubirthplace" name="" value="${user.uplace}" type="text" class="txt7"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>手机号码：</div>
                    <div class="inputtxt">
                        <input id="uphone" value="" name="" type="text" class="txt3"/>
                        <%--                        <span class="phone">${user.uphone}</span>--%>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>电子邮箱：</div>
                    <div class="inputtxt">
                        <input id="uemail" value="" name="" type="text" class="txt3"/>
                        <b>可用来登录</b>
                    </div>
                </div>
            </div>
        </div>
        <div class="clear"></div>
        <div class="JlBoxCon">
            <h1><span>求职意向</span>
                <div></div>
            </h1>
            <div class="JlBoxLeft">
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>求职状态：</div>
                    <div class="inputtxt">
                        <select id="ujobstatus" class="txtcon txt2">
                            <option value="0">离职-随时到岗</option>
                            <option value="1">在职-月内到岗</option>
                            <option value="2">在职-考虑机会</option>
                            <option value="3">在职-暂不考虑</option>
                        </select>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>相关工作经验：</div>
                    <div class="inputtxt">
                        <div id="haveExperience" vul="1" class="typeJob on">有</div>
                        <div id="noHaveExperience" vul="0" class="typeJob">无</div>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>期望工作性质：</div>
                    <div class="inputtxt">
                        <div id="fullTimeJob" vul="0" class="typeJob on">全职</div>
                        <div id="partTimeJob" vul="1" class="typeJob">兼职</div>
                        <div id="practiceJob" vul="2" class="typeJob">实习</div>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>期望月薪：</div>
                    <div class="inputtxt">
                        <select id="uexpectedsalary" class="txtcon txt2">
                            <option value="0">面议</option>
                            <option value="1">30000以上</option>
                            <option value="2">20000-30000</option>
                            <option value="3">10000-20000</option>
                            <option value="4">5000-10000</option>
                            <option value="5">5000以下</option>
                        </select>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>期望工作地点：</div>
                    <div class="inputtxt">
                        <input id="uworkplace" name="" value="${user.uworkplace}" type="text" class="txt7"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>期望职位类别：</div>
                    <div class="inputtxt">
                        <input id="ujobcategory" name="" value="${user.ujobcategory}" type="text" class="txt7"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <button id="next_btn" class="nextBtn">进一步完善</button>
                </div>
            </div>
        </div>
    </div>
    <div id="education_div" class="perRightcon" hidden>
        <div class="JlBoxTit">
            <p class="tit1">基本资料/求职意向</p>
            <div class="tit2"></div>
            <p class="tit3 on">最高学历</p>
        </div>
        <div class="JlBoxCon">
            <h1><span>最高学历</span>
                <div></div>
            </h1>
            <div class="JlBoxLeft">
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>学校名称：</div>
                    <div class="inputtxt">
                        <input id="uschoolname" name="" value="${user.uschoolname}" type="text" class="txt3"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>毕业时间：</div>
                    <div class="inputtxt">
                        <input id="ugraduationtime" type="date" class="txt8"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>学历：</div>
                    <div class="inputtxt">
                        <select id="ueducationalbackground" class="txtcon txt2">
                            <option value="A">初中及一下</option>
                            <option value="B">中专/中技</option>
                            <option value="C">高中</option>
                            <option value="D">大专</option>
                            <option value="E">硕士</option>
                            <option value="F">本科</option>
                            <option value="G">博士</option>
                        </select>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>学历类型：</div>
                    <div class="inputtxt">
                        <select id="ueducationaltype" class="txtcon txt2">
                            <option value="A">普通高等教育（统招）</option>
                            <option value="B">普通专升本（统招）</option>
                            <option value="C">成人高考</option>
                            <option value="D">自考</option>
                            <option value="E">电大</option>
                            <option value="F">网络教育</option>
                        </select>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>专业名称：</div>
                    <div class="inputtxt">
                        <input id="umajorname" name="" value="${user.umajorname}" type="text" class="txt3"/>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <div class="nametxt"><span>*</span>专业类别：</div>
                    <div class="inputtxt">
                        <select id="uprofessionalcategory" class="txtcon txt2">
                            <option value="哲学">哲学</option>
                            <option value="经济学">经济学</option>
                            <option value="法学">法学</option>
                            <option value="教育学">教育学</option>
                            <option value="文学<">文学</option>
                            <option value="历史学">历史学</option>
                            <option value="理学">理学</option>
                            <option value="工学">工学</option>
                            <option value="农学">农学</option>
                            <option value="医学">医学</option>
                            <option value="军事学">军事学</option>
                            <option value="管理学">管理学</option>
                            <option value="艺术学">艺术学</option>
                        </select>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="jldiv">
                    <button id="userinfoupdate" class="saveBtn">填写完毕</button>
                    <button id="previous_btn" class="preBtn">上一步</button>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="clear"></div>
<div class="footer">
</div>
</body>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script>
    $(function () {
        $("#next_btn").on("click", function () {
            $("#base_div").hide();
            $("#education_div").show();

        });
        $("#previous_btn").on("click", function () {
            $("#base_div").show();
            $("#education_div").hide();
        });
    });

    function dateToString(oldTimes) {
        var deliverDate = new Date(oldTimes);
        var year = deliverDate.getFullYear();
        // 格式化日，如果小于9，前面补0
        var day = ("0" + deliverDate.getDate()).slice(-2);
        //格式化月，如果小于9，前面补0
        var month = ("0" + (deliverDate.getMonth() + 1)).slice(-2);
        //拼装完整日期格式
        var deliverDateStr = year + "-" + (month) + "-" + (day);

        return deliverDateStr;

    }

    $(document).ready(function () {

        $("[id='ubirthday']").val(dateToString("${user.ubirthday}"));
        $("[id='ugraduationtime']").val(dateToString("${user.ugraduationtime}"))

        if ("${user.uphone}" != "" && "${user.uphone}" != "null") {
            $("[id='uphone']").val("${user.uphone}")
        }
        if ("${user.uemail}" != "" && "${user.uemail}" != "null") {
            $("[id='uemail']").val("${user.uemail}")
        }

        $("#ujobstatus option[value='${user.ujobstatus}']").prop("selected", true);
        $("#uexpectedsalary option[value='${user.uexpectedsalary}']").prop("selected", true);
        $("#ueducationalbackground option[value='${user.ueducationalbackground}']").prop("selected", true);
        $("#uprofessionalcategory option[value='${user.uprofessionalcategory}']").prop("selected", true);

        var usex = "";
        var uworkexperience = "";
        var uworknature = "";
        if ("${user.uid}" == "") {
            window.location.replace("login.jsp")
        }
        if ("${user.usex}" == "男") {
            usex = "男"
            $("[id='usexman']").addClass("on")
            $("[id='usexwomen']").removeClass("on")
        } else {
            usex = "女"
            $("[id='usexman']").removeClass("on")
            $("[id='usexwomen']").addClass("on")
        }


        if ("${user.uworkexperience}" == "1") {
            uworkexperience = "1"
            $("[id='haveExperience']").addClass("on")
            $("[id='noHaveExperience']").removeClass("on")
        } else {
            uworkexperience = "0"
            $("[id='haveExperience']").removeClass("on")
            $("[id='noHaveExperience']").addClass("on")
        }


        if ("${user.uworknature}" == "0") {
            uworknature = "0";
            $("[id='fullTimeJob']").addClass("on")
            $("[id='partTimeJob']").removeClass("on")
            $("[id='practiceJob']").removeClass("on")
        } else if ("${user.uworknature}" == "1") {
            uworknature = "1";
            $("[id='fullTimeJob']").removeClass("on")
            $("[id='partTimeJob']").addClass("on")
            $("[id='practiceJob']").removeClass("on")
        } else {
            uworknature = "2";
            $("[id='fullTimeJob']").removeClass("on")
            $("[id='partTimeJob']").removeClass("on")
            $("[id='practiceJob']").addClass("on")
        }

        $("[id='usexman']").click(function () {
            usex = $(this).text();
        })
        $("[id='usexwomen']").click(function () {
            usex = $(this).text();
        })
        $("[id='haveExperience']").click(function () {
            uworkexperience = $(this).attr("vul")
        })
        $("[id='noHaveExperience']").click(function () {
            uworkexperience = $(this).attr("vul")
        })
        $("[id='fullTimeJob']").click(function () {
            uworknature = $(this).attr("vul")
        })
        $("[id='partTimeJob']").click(function () {
            uworknature = $(this).attr("vul")
        })
        $("[id='practiceJob']").click(function () {
            uworknature = $(this).attr("vul")
        })

        $("[id='userinfoupdate']").click(function () {
            var uid = "${user.uid}";
            var uname = $("[id='uname']").val()
            var ubirthday = $("[id='ubirthday']").val()
            var uplace = $("[id='uplace']").val()
            var udomicile = $("[id='udomicile']").val()
            var ubirthplace = $("[id='ubirthplace']").val()
            var uphone = $("[id='uphone']").val()
            var uemail = $("[id='uemail']").val()
            var ujobstatus = $("[id='ujobstatus']").val()
            var uexpectedsalary = $("[id='uexpectedsalary']").val()
            var uworkplace = $("[id='uworkplace']").val()
            var ujobcategory = $("[id='ujobcategory']").val()
            var uschoolname = $("[id='uschoolname']").val()
            var ugraduationtime = $("[id='ugraduationtime']").val()
            var ueducationalbackground = $("[id='ueducationalbackground']").val()
            var ueducationaltype = $("[id='ueducationaltype']").val()
            var umajorname = $("[id='umajorname']").val()
            var uprofessionalcategory = $("[id='uprofessionalcategory']").val()


            $.get("upadteUserInfo.do",
                {
                    "uid": uid,
                    "uname": uname,
                    "usex": usex,
                    "ubirthday": ubirthday,
                    "uplace": uplace,
                    "udomicile": udomicile,
                    "ubirthplace": ubirthplace,
                    "uphone": uphone,
                    "uemail": uemail,
                    "ujobstatus": ujobstatus,
                    "uworkexperience": uworkexperience,
                    "uworknature": uworknature,
                    "uexpectedsalary": uexpectedsalary,
                    "uworkplace": uworkplace,
                    "ujobcategory": ujobcategory,
                    "uschoolname": uschoolname,
                    "ugraduationtime": ugraduationtime,
                    "ueducationalbackground": ueducationalbackground,
                    "ueducationaltype": ueducationaltype,
                    "umajorname": umajorname,
                    "uprofessionalcategory": uprofessionalcategory
                }, function (i) {
                    if (i == 1) {
                        // $.get("loginCheckUser.do")
                        alert("信息更改完毕")
                    }
                }
            )
        })


    })
</script>
</html>
